package engineUtil;

import org.lwjgl.Sys;

public class SimpleClock {
private boolean paused=false;

private long dtBegin;

private long dtEnd;

private double dtSeconds;


public void setTimeBegin()
{
dtBegin=Sys.getTime();

}//end

public long getTimeBegin()
{
return dtBegin;
}
public double getDtSeconds() {
	return dtSeconds;
}

public void setDtSeconds(double dtSeconds) {
	this.dtSeconds = dtSeconds;
	
}

public void setTimeBegin(long time)
{
dtBegin = time;
}

public boolean isPaused() {
	return paused;
}

public void setPaused(boolean paused) {
	this.paused = paused;
}

public double calcDelta()
{
	dtEnd=Sys.getTime();
	//return dtSeconds=((double)(dtEnd-dtBegin)/Sys.getTimerResolution());
	return dtSeconds=((double)(dtEnd-dtBegin));
}//end calc delta

public void incrementTime(int period)
{
	dtBegin += period;
}//incrementTime

public void updateTime()
{
	if(!paused)
	{
	
		dtBegin=dtEnd;
	
	}//end if
	
}//end update time


public void singleStep()
{

	
		
		dtSeconds=1/30;
		
	
}//end

}
